package cn.buk.tms.eotms.dto;

import cn.buk.tms.eotms.entity.BillTrainTicket;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.beans.BeanUtils;

import java.util.Date;


public class SettlementReportTrainDto {


    public static SettlementReportTrainDto createdBy(BillTrainTicket o) {
        SettlementReportTrainDto dto = new SettlementReportTrainDto();

        BeanUtils.copyProperties(o, dto);

        dto.setOrderDate(o.getSaleDate());

        return dto;
    }

    public double getTotalAmount() {
        return this.price * this.getPsgCount() + this.serviceCharge;
    }

    /**
     * 销售日期, 订单日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
    private Date orderDate;

  /**
     * 姓名
     */
    private String passengerName;

    private Integer psgCount;


    /**
     * 车次
     */
    private String trainNo;

    /**
     * 出发地
     */
    private String dcity;

    /**
     * 目的地
     */
    private String acity;

    /**
     * 日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
    private Date ddate;

    /**
     * 座位等级
     */
    private String seatClass;

    /**
     * 价格/人
     */
    private double price;

    /**
     * 服务费(总)
     */
    private double serviceCharge;



    public Date getOrderDate() {
        return orderDate;
    }

    public void setOrderDate(Date orderDate) {
        this.orderDate = orderDate;
    }

    public String getPassengerName() {
        return passengerName;
    }

    public void setPassengerName(String passengerName) {
        this.passengerName = passengerName;
    }

    public Integer getPsgCount() {
        return psgCount;
    }

    public void setPsgCount(Integer psgCount) {
        this.psgCount = psgCount;
    }

    public String getTrainNo() {
        return trainNo;
    }

    public void setTrainNo(String trainNo) {
        this.trainNo = trainNo;
    }

    public String getDcity() {
        return dcity;
    }

    public void setDcity(String dcity) {
        this.dcity = dcity;
    }

    public String getAcity() {
        return acity;
    }

    public void setAcity(String acity) {
        this.acity = acity;
    }

    public Date getDdate() {
        return ddate;
    }

    public void setDdate(Date ddate) {
        this.ddate = ddate;
    }

    public String getSeatClass() {
        return seatClass;
    }

    public void setSeatClass(String seatClass) {
        this.seatClass = seatClass;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public double getServiceCharge() {
        return serviceCharge;
    }

    public void setServiceCharge(double serviceCharge) {
        this.serviceCharge = serviceCharge;
    }

}
